<%@include file="/WEB-INF/pages/commons/commons.jsp"%>

<fmt:message var="title" key="view_resources.jsp.title" scope="request"/>
<stripes:layout-render name="${_themePath}/basic-layout-without-navbar.jsp" _title="${title}">

    <stripes:layout-component name="_topNav">
            <H1>Blog Management</H1>
            <UL class="gc-topnav-tabs">
                <LI>&nbsp;</LI>
            </UL>
    </stripes:layout-component>

    <stripes:layout-component name="_content">

        <h2>Edit</h2>
        <jsecurity:lacksPermission name="blog:editResource:${actionBean.resource.entry.blog.id}">
            No "blog:editResource:${actionBean.resource.entry.blog.id}" permission
        </jsecurity:lacksPermission>

        <jsecurity:hasPermission name="blog:editResource:${actionBean.resource.entry.blog.id}">
        <stripes:form beanclass="foo.bar.blog.web.action.registered.BlogsProfileActionBean">
            <stripes:errors/>

            <input type="hidden" name="resource" value="${actionBean.resource.id}"/>
            <input type="hidden" name="blogEntry" value="${actionBean.resource.entry.id}"/>
            <input type="hidden" name="resource.name" value="${actionBean.resource.name}"/>

            <table width="100%">
                <tr>
                    <td>
                        <label>
                            <fmt:message key="foo.bar.blog.web.action.registered.BlogsProfileActionBean.resource.path"/>
                        </label>
                    </td>
                    <td>
                        The resource is accessible through either
                        <ul>
                            <li>url: /Resource.action?resource=${actionBean.resource.id}</li>
                            <li>wiki syntax: {#${actionBean.resource.name}}</li>
                        </ul>
                    </td>
                </tr>
                <tr>
                    <td><stripes:label name="resource.id"/></td>
                    <td><stripes:text name="resource.id" disabled="true"/></td>
                </tr>
                <tr>
                    <td><stripes:label name="resource.name"/></td>
                    <td><stripes:text name="resource.name" disabled="true"/></td>
                </tr>
                <tr>
                    <td><stripes:label name="resource.description"/></td>
                    <td><stripes:text name="resource.description"/></td>
                </tr>
                <tr>
                    <td><stripes:label name="resourceFile"/></td>
                    <td><stripes:file name="resourceFile"/></td>
                </tr>
                <tr>
                    <td colspan="2">
                        <stripes:submit name="updateResource"><fmt:message key="add_resource.jsp.saveResource"/></stripes:submit>
                    </td>
                </tr>
            </table>
        </stripes:form>
        </jsecurity:hasPermission>
    </stripes:layout-component>
</stripes:layout-render>

